package com.service;

import com.bean.UserInfo;

public class OnesCalculate {
	private final static String NORM="";
	
	public static double getEnergy(UserInfo ui){
		int norm=0;
		if("女".equals(ui.getSex())){
			double d=655+(9.5*ui.getWeight())+(1.8*ui.getHeight())-(4.7*ui.getAge());
			norm+=d;
		}else if("男".equals(ui.getSex())){
				double d=66+(13.7*ui.getWeight())+(5*ui.getHeight())-(6.8*ui.getAge());
				norm+=d;
		}
		return norm;
	}
	
	public static String getNorm(UserInfo ui){
		return ""+getEnergy(ui)+NORM;
	}
			
}
